import request from "@/utils/request";

// 获取列表
export function listData(query) {
  return request({
    url: `/system-set/role`,
    method: "get",
    params: query
  });
}

// 获取权限联动
export function getPermission() {
  return request({
    url: `/permission/cachedata`,
    method: "get"
  });
}

// 获取菜单联动
export function getMenu() {
  return request({
    url: `/menu/cachedata`,
    method: "get"
  });
}

// 获取角色详情
export function getRoleDetail(query) {
  return request({
    url: `/role/detail${query}`,
    method: "get"
  });
}

// 角色添加
export function postAddData(form) {
  return request({
    url: `/role/add`,
    method: "post",
    data: form
  });
}

// 角色编辑
export function postEditData(form) {
  return request({
    url: `/role/edit`,
    method: "post",
    data: form
  });
}

// 角色删除
export function deleteData(id) {
  return request({
    url: `/system-set/role`,
    method: "delete",
    data: { id }
  });
}
